<!DOCTYPE html>
{% from "macros.html" import cmsmenu %}
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>cmsindex</title>
    <style>
        h1{
            text-align: center;
        }
        #user_online{
            float: right;
            margin-right: 3px;
        }
        table{
            margin:auto;
        }
    </style>
    <link rel="stylesheet" href="{{ url_for ('static',filename='css/bootstrap.css')}}">
    <link rel="stylesheet" href="{{ url_for ('static',filename='css/flask.css')}}">
</head>
<body>
{{ cmsmenu(post_name,online) }}
{#<h1>阳光婚姻信息匹配管理系统</h1>#}
{#<div class="navbar-collapse collapse" id="menu">#}
{#    <ul class="nav navbar-nav">#}
{#        <li><a href="{{ url_for('regist') }}">注册页面</a></li>#}
{#        <li><a href="{{ url_for('login') }}">切换账号</a></li>#}
{#        <li><a href="{{ url_for('cmsloginrecord') }}">查看今日登陆</a></li>#}
{#        <li><a href="{{ url_for('cmselectuser') }}">查看所有账号</a></li>#}
{#        <li><a href="{{ url_for('cmselectarticle') }}">查看所有文章</a></li>#}
{#    </ul>#}
{#    <h4 id="user_online">{{ post_name }}{{ online }}</h4>#}
{#    <br><br><br><br><br>#}
{#</div>#}
<div>
<form action="" method="post">
    <table>
        <tr>
            <td><input class="form-control" type ='text' name="articleid"></td>
            <td><input class="form-control" type="submit" value="输入文章id搜索"></td>
        </tr>
    </table>
</form>
<div id="content">
<div>
    <table border="1" class="table" style="width:1300px">
    <tr>
        <td>文章id</td>
        <td>作者</td>
        <td>文章内容</td>
        <td>发布时间</td>
        <td>管理员操作</td>
    </tr>
    {% for list in pagination %}
          <tr>
          <td>{{ list.articleid }}</td>
          <td>{{ list.username }}</td>
          <td>{{ list.articlecontent }}</td>
          <td>{{ list.time }}</td>
          {% set id = list.articleid|string  %}
          <td><a href="/cmselectarticle_delete/{{ id }}"><button class="btn btn-danger">删除所有记录</button></a></td>
          </tr>
    {% endfor %}
</table>
<div style="text-align: center">
{% if page>1 %}
    <a href="{{ url_for("cmselectarticle") }}?page={{ page-1 }}">上一页</a>
{% endif %}
{% for i in range(post_times) %}
    <a href="{{ url_for("cmselectarticle") }}?page={{ i+1 }}">{{ i+1 }}</a>
{% endfor %}
{% if page<10 %}
    <a href="{{ url_for("cmselectarticle") }}?page={{page+1}}">下一页</a>
{% endif %}
</div>
</div>
</div>

</body>
</html>